
'use strict';

/**
	Part of Zombie Navigator
	Copyright © 2015  Zombie Navigator Developers
	
	@file
	@module
	@license AGPL-3.0+
*/


/* Addon SDK dependencies */
const _sdkNotifications = require('sdk/notifications');


/* Used modules */
const _modMeta = require('./meta');


/* Private properties */

/**
	TODO: Profiling
	@private
*/
const _history = [];

/**
	TODO: Profiling
	@private
*/
let _historyEnabled = true;

/**
	TODO: Profiling
	@private
*/
const _addHistory = message => {
	if (_historyEnabled) {
		_history.push(message);
	}
};


/* Exported APIs */

/**
	@public
	@method
	@returns {boolean}
*/
const showNotification = message => {
	const sdkNotifications = _sdkNotifications;
	const modMeta = _modMeta;
	
	message = message + '';
	
	_addHistory(message);
	
	return false !== sdkNotifications.notify({
		title: modMeta.getProductName()
		, text: message
	});
};


/* Exports */
exports.showNotification = showNotification;


// vim: ts=4 noet ai

